<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 


<h:head>
	<title>Prosperous</title>
	<link rel="stylesheet" href="../../../resources/styles/layout.css" type="text/css"/>
	
</h:head>


<h:body>
	<h:form id="form1">
	
	<div class="wrapper row1">
	  <header id="header" class="clear">
	    <hgroup>
	      <h1><a href="index.html">Cardápio Mobile</a></h1>
	      <h2>Seu cardápio para o mundo todo </h2>
	    </hgroup>
			<fieldset class="fl_right">
		    	<p:panel style="width:300px;height:50px;right:200px;top:60px;background:#696969;border:1px solid black">  
			    	<h:outputText style="font-weight:bold;color:#FFFFE0;" value="Usuário:"/>
					<h:outputText style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeUsuario')}"/>  
					<fieldset>		
						<h:outputText value="Acesso: " style="font-weight:bold;color:#FFFFE0;"/>  
						<h:outputText id="restaurante" style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeFantasia')}"/>
						
						<p:spacer width="75" height="13"/>                                  

						<p:commandButton id="btnNoticia" type="button" icon="ui-iconNews" style="width:25px;height:25px;background:#696969" rendered="#{portalCardapioMB.statusPlanoVencendo}" /> 
						<p:menu overlay="true" trigger="btnNoticia" my="left top" at="left bottom" style="width:300px;height:30px"> 
								<p:menuitem value="#{portalCardapioMB.msgPlanoVencendo}" 
								style="background:#F5F5F5;color: red;font-size:13px;font-weight:bold;" />
						</p:menu>
						
					</fieldset>  
				</p:panel> 
			</fieldset>
			<fieldset>
			<p></p>
			</fieldset>
			
	    <nav class="clear">
	      <ul>

	        <li class="active"><a href="#">Minha Conta</a>
	          <ul>
	            <li><a href="portalCardapioMundo.jsf">Portal Home</a></li>
	            <li><a href="../user/meusDados.jsf">Meus Dados</a></li>
	            <li><a href="portalCardapioMundo.jsf?changeAccess=EEN013550">Trocar Acesso</a></li>
	            <li onclick="PF('dlgSair').show();"><a href="#">Sair</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Acesso</a>
	          <ul>
	            <li><a href="../admin/cadUsuario.jsf">Novo Usuário</a></li>
	            <li><a href="../user/consUsuario.jsf">Consulta Usuários</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>
	        
	        <li><a href="#">Restaurante</a>
	          <ul>
	            <li><a href="../admin/cadRestauranteFilial.jsf?operation=ADDFILIAL">Nova Filial</a></li>
	            <li><a href="../user/consRestaurante.jsf?operation=ALTRESTAURANTE">Consulta Restaurante</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Cardápio</a>
	          <ul>
	            <li><a href="../user/cardapio/opcaoCardapios.jsf">Novo Cardápio</a></li>
	            <li><a href="../user/cardapio/consCardapios.jsf">Cardápios</a></li>
	            <li><a href="../user/cardapio/consCardapios.jsf">Agendamento</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Business Intelligence</a>
	          <ul>
	            <li><a href="#">Avaliações Cardápio</a></li>
	            <li><a href="#">Avaliações Atendimento</a></li>
	            <li><a href="#">Avaliações Infraestrutura</a></li>
	            <li><a href="#">Avaliação Geral</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Plano</a>
	          <ul>
	           <li><a href="../user/meuPlano.jsf">Meu Plano</a></li>
	           <li><a href="../admin/renovacao.jsf">Renovação Conta</a></li>
	           <li><a href="../user/planos.jsf">Planos</a></li>
	          </ul>
	        </li>
	      </ul>
	    </nav>
	  </header>
	</div>
	
		<p:dialog id="dialogSair" header="Opção Logout" modal="true" height="85" width="510" widgetVar="dlgSair" resizable="false" 
		showEffect="fade" hideEffect="fade">  
			<h:panelGrid columns="2" cellpadding="5">  
				<h:outputText for="username" value="Deseja desconectar do portal Cardápio Mobile ?" style="font-size:15px"/>
			</h:panelGrid>
					          
			<f:facet name="footer">  
				<p class="fl_left">
				<p:commandButton id="cancelarButton" value="Cancelar" height="50" width="50" onclick="PF(dlgSair).hide();"/>
				</p>
				<p class="fl_right">
					<p:commandButton id="sairButton" value="Sair" height="50" width="50" actionListener="#{acessoMB.logout}"/>
				</p>  
			</f:facet>  
	    </p:dialog>
    
	</h:form>  	    			
	
	
	<h:form id="form2">
		<p:growl id="msg" showDetail="true" life="3000" />
	
	 <!-- ############################ DIALOG 1 ::  PANEL ATIVA / DESATIVA RESTAURANTE  ############################ -->
	 <p:dialog header="#{contratoMB.displayDetalhesRestaurante}" id="contratoRestauranteDetalheDialog" widgetVar="contratoRestauranteDialog" modal="true" height="300" width="480" showEffect="fade" hideEffect="fade" resizable="false">
        <p:outputPanel id="restauranteDetail">
            <p:panelGrid  columns="2" columnClasses="label,value">
                <f:facet name="header">	
                	<p:row>
                		<p:column style="text-align:left">
		  					<p:graphicImage width="30" height="30" value="../../../resources/icones/nok.ico"
		  					rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 0}"/>
		  					<p:graphicImage width="30" height="30" value="../../../resources/icones/ok.ico"
							rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 1}"/>                    
		  				</p:column>
		  				<p:column style="text-align: center">
		                    <p:spacer width="50" height="50" rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 0}" />  
		                    <h:outputText value="#{contratoMB.INATIVOs}" rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 0}"  
		                    style="color:red;font-size:20px;font-weight:bold;"/>
		
		                    <p:spacer width="-30" height="50" rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 1}"/>  
		                    <h:outputText value="#{contratoMB.ATIVOs}" 
		                    rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 1}"  style="color:green;font-size:20px;font-weight:bold;"/>
		                </p:column>
					</p:row>					
                </f:facet>

                <h:outputText value="Qtde Cardápio Buffet" style="color:#696969;font-size:14px;font-weight:bold;"/>
                <h:outputText value="#{contratoMB.restaurantesContratoSelect.qtdeCardBuffet}" style="color:blue;font-size:18px;font-weight:bold;"/>
 
                <h:outputText value="Qtde Cardápio SelfService" style="color:#696969;font-size:14px;font-weight:bold;"/>
               	<h:outputText value="#{contratoMB.restaurantesContratoSelect.qtdeCardSelfService}" style="color:blue;font-size:18px;font-weight:bold;" />
                
                <h:outputText value="Qtde Cardápio LaCarte" style="color:#696969;font-size:14px;font-weight:bold;"/>
               	<h:outputText value="#{contratoMB.restaurantesContratoSelect.qtdeCardLaCarte}" style="color:blue;font-size:18px;font-weight:bold;" />
 
                <h:outputText value="Qtde  Cardápio Infantil" style="color:#696969;font-size:14px;font-weight:bold;"/>
               	<h:outputText value="#{contratoMB.restaurantesContratoSelect.qtdeCardInfantil}" style="color:blue;font-size:18px;font-weight:bold;" />
                
                <h:outputText value="Qtde  Cardápio Especialidade" style="color:#696969;font-size:14px;font-weight:bold;"/>
               	<h:outputText value="#{contratoMB.restaurantesContratoSelect.qtdeCardEspecialidade}" style="color:blue;font-size:18px;font-weight:bold;" />
            </p:panelGrid>
            
            <br/>
            <br/>
            
            <div align="center">
				<p:commandButton value="Ativar Restaurante" id="btnAtivaRestaurante"
				icon="ui-iconAtiva" onclick="PF('dlgMsgAtivacao').show();"  style="background-color: #228B22" 
				rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 0}" />
														
				<p:commandButton value="Desativar Restaurante" id="btnDesativarRestaurante"
				icon="ui-iconDesativa" onclick="PF('dlgMsgInativacao').show();"  style="background-color: #CD5C5C" 
				rendered="#{contratoMB.restaurantesContratoSelect.statusCode == 1}" />
			</div>
        </p:outputPanel>
    </p:dialog>
    
    <p:dialog id="dialogMsgInativacao" header="Inativar Cardápio" modal="true" height="100"
		width="390" widgetVar="dlgMsgInativacao" resizable="false" showEffect="fade" hideEffect="fade">  
		
		<h:outputLabel value="#{msgs.msgInativacaoRestaurante}" style="font-size:15px"/>
		<f:facet name="footer">  
			<p class="fl_left">
				<p:commandButton value="Cancela  Inativação" image="ui-confirmdialog-no" icon="ui-icon-close"  onclick="PF('dlgMsgInativacao').hide();"/>
			</p>
			
			<p class="fl_right">
				<p:commandButton value="Confirma Inativação" image="ui-icon ui-icon-search" update="@form" 
				action="#{contratoMB.statusInativarRestauranteContrato()}"  onclick="PF('dlgMsgInativacao').hide();"/>
			</p>  
		</f:facet>
	</p:dialog>
	
	
	<p:dialog id="dialogMsgAtivacao" header="Ativar Cardápio" modal="true" height="100"
		width="390" widgetVar="dlgMsgAtivacao" resizable="false" showEffect="fade" hideEffect="fade">  
		
		<h:outputLabel value="#{msgs.msgAtivacaoRestaurante}" style="font-size:15px"/>
		<f:facet name="footer">  
			<p class="fl_left">
				<p:commandButton value="Cancela  Ativação" image="ui-confirmdialog-no" icon="ui-icon-close"  onclick="PF('dlgMsgAtivacao').hide();"/>
			</p>
			
			<p class="fl_right">
				<p:commandButton value="Confirma Ativação" image="ui-icon ui-icon-search" update="@form" 
				action="#{contratoMB.statusAtivaRestauranteContrato()}" onclick="PF('dlgMsgAtivacao').hide();"/>
			</p>  
		</f:facet>
	</p:dialog>
	
	
	<!-- ############################ DIALOG 4 ::  ESCOLHA FORMA PAGAMENTO  ############################ -->
	<p:dialog id="formaPagamentoDialog" closable="true" header="Forma Pagamento" modal="true" style="background-color:#E0EEE0" 
		height="530" width="1090" widgetVar="dlgFormaPagRenovacao" resizable="false" styleClass="disable-scroll">
		
		<p:dataGrid var="formaPagamento" value="#{formaPagamentoMB.formaPagamentoL}" columns="3" layout="grid"
		rows="12" paginator="true" id="formaPagto" rowsPerPageTemplate="6" style="height:50%; border:1px">
					 
			<f:facet name="header">
				MEIO DE PAGAMENTO
			</f:facet>
					 
			<p:panel header="#{formaPagamento.nomePagamento}" style="text-align:center">
				<h:panelGrid columns="1" style="width:100%;height:10%">
					<p:graphicImage value="#{formaPagamento.imagem}" style="vertical-align: middle;" width="70" height="70"/> 
	                <h:outputText value="#{formaPagamento.descricaoPagamento}" />
					
					<p:commandButton value="Pagar Agora" icon="ui-icon-addPagamento" action="#{contratoMB.loadDialogConfirmaPagamento()}"
					oncomplete="PF('dlgPagamentoRenovacao').show()" update=":form2:pagamentoDialog" >
						<f:setPropertyActionListener value="#{formaPagamento}" target="#{contratoMB.selectFormaPagamento}" />
					</p:commandButton>					 
				</h:panelGrid>
			</p:panel>
		</p:dataGrid>
		
		<f:facet name="footer">	  
			<p class="fl_left">                                               
				<p:commandButton  value="#{msgs.Voltar}" icon="ui-icon-check" onclick="PF('dlgFormaPagRenovacao').hide()"/>
			</p>  
		</f:facet>	 		
	</p:dialog>
	
				
    <!-- ############################ DIALOG 5 ::  PAGAMENTO   ############################ -->
	<p:dialog id="pagamentoDialog" closable="true" header="Pagamento Parcela" modal="true" style="background-color:#E0EEE0" 
		height="440" width="560" widgetVar="dlgPagamentoRenovacao" resizable="false" styleClass="disable-scroll" >
			 		
		<p:panel id="pagCartaoCredito" header="Cartão Crédito"  style="margin-bottom:20px" rendered="#{contratoMB.statusCartaoCredito}">
			<h:panelGrid columns="2" cellpadding="5">
				<h:outputText value="#{msgs.tipoCartao}" />
				<p:graphicImage value="#{contratoMB.cartaoCreditoImg}" style="vertical-align: top;" width="50" height="50" />

				<h:outputText value="#{msgs.nomeTitula}" />
				<p:inputText value="#{contratoMB.selectContratoPagamento.titularPagamento}" size="35"/>

				<h:outputText value="#{msgs.numeroCartao}" />
				<p:inputText value="#{contratoMB.selectContratoPagamento.codeTransacao}"/>
				    		
				<h:outputText value="#{msgs.codSegCartao}" />
				<p:inputMask  placeHolder="" value="#{contratoMB.formaPagVO.codSeguranca}" maxlength="3" size="3"/>
				    		  
				    		
				<h:outputText value="#{msgs.dataValidade}" />
				<h:panelGrid columns="3" cellpadding="5">
	 				<p:selectOneMenu id="mesCard" value="#{contratoMB.formaPagVO.mes}" style="width:150px">
						<f:selectItem itemLabel="Select mês" itemValue="" noSelectionOption="true" />
	       				<f:selectItem itemLabel="01" itemValue="01" />
	       				<f:selectItem itemLabel="02" itemValue="02" />
	       				<f:selectItem itemLabel="03" itemValue="03" />
	       				<f:selectItem itemLabel="04" itemValue="04" />
	       				<f:selectItem itemLabel="05" itemValue="05" />
	       				<f:selectItem itemLabel="06" itemValue="06" />
	       				<f:selectItem itemLabel="07" itemValue="07" />
	       				<f:selectItem itemLabel="08" itemValue="08" />
	       				<f:selectItem itemLabel="09" itemValue="09" />
	       				<f:selectItem itemLabel="10" itemValue="10" />
	       				<f:selectItem itemLabel="11" itemValue="11" />
	       				<f:selectItem itemLabel="12" itemValue="12" />
	            	</p:selectOneMenu>
	            				
	 				<p:selectOneMenu id="anoCard" value="#{contratoMB.formaPagVO.ano}" style="width:150px">
						<f:selectItem itemLabel="Select ano" itemValue="" noSelectionOption="true" />
	       				<f:selectItem itemLabel="2015" itemValue="2015" />
	       				<f:selectItem itemLabel="2016" itemValue="2016" />
	       				<f:selectItem itemLabel="2017" itemValue="2017" />
	       				<f:selectItem itemLabel="2018" itemValue="2018" />
	       				<f:selectItem itemLabel="2019" itemValue="2019" />
	       				<f:selectItem itemLabel="2020" itemValue="2020" />
	       				<f:selectItem itemLabel="2021" itemValue="2021" />
	       				<f:selectItem itemLabel="2022" itemValue="2022" />
	       				<f:selectItem itemLabel="2023" itemValue="2023" />
	       				<f:selectItem itemLabel="2024" itemValue="2024" />
	       				<f:selectItem itemLabel="2025" itemValue="2025" />
	       				<f:selectItem itemLabel="2026" itemValue="2026" />
	            	</p:selectOneMenu>
	            </h:panelGrid>
	       	</h:panelGrid>	

			<h:outputText value="#{contratoMB.selectPlanoVO.nomePlano}" style="color:#EE0000;font-weight:bold;font-size:20px;"/>

			<!-- GRID PAGAMENTO CONTRATO EM ATRASO  -->
			<h:panelGrid columns="2" cellpadding="5" style="background-color:#FFF8DC" columnClasses="gridCol1With1-2Col,gridCol2With1-2Col" 
   	        styleClass="ui-panelgrid" rendered="#{contratoMB.statusPagamentoAtrasoPlano}">
				<h:outputText value="#{msgs.parcelaPlano}" style="color:#708090;font-weight:bold;font-size:17px;"/>
				<h:outputText value="#{contratoMB.selectContratoPagamento.parcela}" style="color:#A52A2A;font-weight:bold;font-size:20px;"/>
	            <h:outputText value="#{msgs.valorParcela}" style="color:#708090;font-weight:bold;font-size:17px;" />
				<h:outputText value="#{contratoMB.valorPlanoFormatado}" style="color:#A52A2A;font-weight:bold;font-size:20px;"/>
			</h:panelGrid>

			<!-- GRID PAGAMENTO NOVO PLANO NO CONTRATO -->
			<h:panelGrid columns="2" cellpadding="5" style="background-color:#FFF8DC" columnClasses="gridCol1With1-2Col,gridCol2With1-2Col" 
   	        styleClass="ui-panelgrid" rendered="#{contratoMB.statusPagamentoNovoPlano}">
				    		
            	<h:outputText value="#{msgs.planoValor}" style="color:#708090;font-weight:bold;font-size:17px;" />
			    <h:outputText value="#{contratoMB.valorPlanoFormatado}" style="color:#A52A2A;font-weight:bold;font-size:20px;"/>
								
		        <h:outputText value="#{msgs.planoDesconto}" style="color:#708090;font-weight:bold;font-size:17px;"/>
			    <h:outputText value="#{contratoMB.descontoFormatadoTrocaPlano}" style="color:#483D8B;font-weight:bold;font-size:20px;" />
   
				<h:outputText value="" style="color:#EED2EE;font-weight:bold;font-size:17px;"/>
				<h:selectOneMenu id="pagamentoTipo" value="#{contratoMB.numeroParcelaPagamento}">
					<f:selectItem itemLabel="Parcelamento Plano" itemValue=""/>
					<f:selectItems value="#{contratoMB.listaParcelaPagamentoL}" var="parcela" itemLabel="#{parcela.textoParcela}" 
					itemValue="#{parcela.numeroParcela}"/>  
				</h:selectOneMenu>
			
				<h:outputText value="#{msgs.planoTotal}" style="color:#708090;font-weight:bold;font-size:20px;" />
			    <h:outputText value="#{contratoMB.totalPagamentoFormatado}" style="color:black;font-weight:bold;font-size:20px;" /> 
			</h:panelGrid>
			
		</p:panel>
					 
 		<p:panel id="pagBoleto" header="Boleto Bancário" style="margin-bottom:20px" rendered="#{contratoMB.statusBoleto}">
			<h:panelGrid columns="2" cellpadding="10">
				<h:outputText value="#{msgs.tipoCartao}" />
				</h:panelGrid>
		</p:panel>
					 
  		<p:panel id="pagPayPal" header="PayPal" style="margin-bottom:20px" rendered="#{contratoMB.statusPayPal}">
			<h:panelGrid columns="2" cellpadding="10">
				<h:outputText value="#{msgs.tipoCartao}" />
			</h:panelGrid>
		</p:panel>			 		
					 			 		
  		<p:panel id="pagItau" header="Transferencia Itaú" style="margin-bottom:20px" rendered="#{contratoMB.statusItau}">
			<h:panelGrid columns="2" cellpadding="10">
				<h:outputText value="#{msgs.tipoCartao}" />
			</h:panelGrid>
		</p:panel>
					 
					 
		<f:facet name="footer">	  
			<p class="fl_left">                                               
				<p:commandButton  value="#{msgs.Voltar}" icon="ui-icon-check" onclick="PF('dlgPagamentoRenovacao').hide()"/>
			</p>  
			<p class="fl_right">
				<p:commandButton value="#{msgs.ConfirmaPagamento}" icon="ui-icon-check" 
				action="#{contratoMB.efetuaPagamentoParcelaEmAtraso}" update="@form" />
			</p>
			
			
		</f:facet>	 		
	</p:dialog>
	
	
	<!-- ############################ DIALOG  ::  ESCOLHE PLANO RENOVAÇÃO  ############################ -->
			
	<p:dialog id="definePlanoDialog" closable="true" header="Alteração Plano" modal="true" style="background-color:#E0EEE0" 
		height="480" width="1090" widgetVar="dlgAlteraPlano" resizable="false" showEffect="fade" hideEffect="fade" styleClass="disable-scroll">
					
		<div align="center">							
			<p:carousel id="crlPlanos" itemStyle="width:320px;height:410px;background-color:#{plano.corPanelPlano}" 
				value="#{planoMB.planoL}" headerText="" var="plano"> 
				<h:panelGrid columns="1" width="100%" style="text-align:center" cellpadding="5" columnClasses="label,value" styleClass="ui-panelgrid">
					<f:facet name="header">
						<h:outputText id="notificacaoPlanoVencidoutputText" value="#{plano.nomePlano}" style="color:#B0E2FF;font-size:30px;font-weight:bold;"/>
					</f:facet>
					<div align="center">
						<br/>
						<h:outputText value="#{plano.beneficioQtdeCardapioS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
						<h:outputText value="#{plano.beneficioQtdeFilialS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
						<h:outputText value="#{plano.beneficioPeriodoAssinaturaS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
						<h:outputText value="#{plano.beneficioTexto}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
						<br/>
					</div>
				</h:panelGrid>
				
	           	<div align="center">
					<h:outputText value="#{plano.moeda}" style="color:838B8B;font-weight:bold;font-size:18px;"/>
					<h:outputText value="#{plano.valor}" style="color:blue;font-size:30px;font-weight:bold;"/>
					<h:outputText value="#{plano.periodicidadeTipoFormatado}" style="color:838B8B;font-weight:bold;font-size:18px;"/>
					<br/>
					<br/>
					<br/>
				</div>

				<p:commandButton value="#{msgs.RenovarPlano}"  icon="ui-icon-addPagamento" action="#{alteracaoPlanoMB.validaOperacaoAlteracaoPlano()}"
				update=":form2:dialogUpDowPlano">
					<f:setPropertyActionListener value="#{plano}" target="#{contratoMB.selectPlanoVO}" />
				</p:commandButton>					 
			</p:carousel>
		</div>
	</p:dialog>
	
	
	<p:dialog id="dialogUpDowPlano" header="Alteração Plano" modal="true" height="85" width="510" widgetVar="dlgUpgradeDowngradePlano" resizable="false" 
	showEffect="fade" hideEffect="fade">  
		<h:panelGrid columns="2" cellpadding="5">  
			<h:outputLabel for="username" value="#{contratoMB.msgUpDownGradePlano}" style="font-size:15px"/>
		</h:panelGrid>
				          
		<f:facet name="footer">  
			<p class="fl_left">
			<p:commandButton id="cancelarButton" value="Cancelar" height="50" width="50" onclick="PF(dlgSair).hide();"/>
			</p>
			<p class="fl_right">
				<p:commandButton id="sairButton" value="Sair" height="50" width="50" actionListener="#{acessoMB.logout}"/>
			</p>  
		</f:facet>  
    </p:dialog>
	
	
	<!-- ######################################################3####### BODY PAGE  ############################################################ -->
	
	
	<div class="wrapper row2">
	    <div id="container" class="clear"> 
	    	<div id="homepage">
				<p:messages id="mensagem" for="mensagem" showDetail="true" autoUpdate="true"/>
				
				<p:panel id="meuPlanoPanel" header="Meu Plano Contrato" style="color:red;font-size:16px;background-color:Gray">

					<p:toolbar id="menu">  
				  		 <f:facet name="left">
						     <p:commandButton title="Salvar" icon="ui-iconSave" actionListener="#{contratoMB.alterarContrato}" 
						     disabled="#{contratoMB.statusEditar}" style="width:40px;height:40px;" update="@form"/>
								<p:separator />
								
							<p:commandButton  title="Alterar" icon="ui-iconEditar" style="width:40px;height:40px;"
					  		action="#{contratoMB.editarCampos}" immediate="true" update="meuPlanoPanel" disabled="#{contratoMB.statusBtnAlterar}"/>
								<p:separator />
							
							<p:commandButton title="Cancelar" type="reset" icon="ui-iconLimpar" ajax="true" update="meuPlanoPanel"
							disabled="#{contratoMB.statusEditar}" style="width:40px;height:40px;"/>
					         <p:separator />
					         
					        <p:commandButton title="Alterar Plano" icon="ui-iconAlteraContrato" update="meuPlanoPanel"
							style="width:40px;height:40px;"  actionListener="#{contratoMB.redirecionaAlteraPlanoContrato()}" >
					  			<f:setPropertyActionListener value="#{true}" target="#{contratoMB.statusPagamentoNovoPlano}" />
							</p:commandButton>
					         
						</f:facet>  
					</p:toolbar>
					<div style="height:0px"></div>
					<p:sticky  target="menu" />
					
					
  					<p:tabView id="tabGerenciamentoPlano" effect="fade" effectDuration="normal" style="background-color:#FAFAFA;height:680px">
		   				
		   				<p:tab id="tabPlano" title="Plano" titleStyle="background-color:red">  
						
							<p:panelGrid columns="1" layout="grid" styleClass="ui-panelgrid">
								<p:row>        
									<h:outputText id="PlanoContratado" value="PLANO  CONTRATADO" style="color:#B0B0B0;font-size:12px;font-weight:bold;"/>
									<br />
									<h:outputText id="nomePlano" size="60" value="#{contratoMB.planoVO.nomePlano}" style="color:#A52A2A;font-size:19px;font-weight:bold;"/>
								</p:row>
	    					</p:panelGrid>
	
							<br />
									
							<p:panelGrid style="margin-bottom:20px">
							
								<p:row>
									<h:outputText id="InformacoesPlano" value="INFORMAÇÕES PLANO" style="color:#B0B0B0;font-size:12px;font-weight:bold;"/>
								</p:row>
							    <f:facet name="header">
							        <p:row>
							            <p:column colspan="7"></p:column>
							        </p:row>
							        <p:row>
							            <p:column colspan="2">
							            	<h:outputText value="#{msgs.planoBeneficioQtdeCardapio}" />
							            </p:column>
	
							            <p:column colspan="2">
							            	<h:outputText value="#{msgs.planoBeneficioQtdeFilial}" />
							            </p:column>
	
							            <p:column colspan="2">
							            	<h:outputText value="#{msgs.planoBeneficioPeriodoAssinatura}" />
							            </p:column>
	
							            <p:column>
							            	<h:outputText value="#{msgs.planoBeneficioSuporteCadCardapio}" />
							            </p:column>
							        </p:row>
							    </f:facet>
									 
								<p:row> 
									<p:column colspan="2" style="color:blue;font-size:16px;text-align:center">
							         	<h:outputText value="#{contratoMB.planoVO.beneficioQtdeCardapioS}"/>
									</p:column>
									 
									<p:column colspan="2"  style="color:blue;font-size:16px;text-align:center">
								       	<h:outputText value="#{contratoMB.planoVO.beneficioQtdeFilialS}" />
								    </p:column>
	
							        <p:column colspan="2" style="color:blue;font-size:16px;text-align:center">
							        	<h:outputText value="#{contratoMB.planoVO.beneficioPeriodoAssinaturaS}"/>
							        </p:column>
	
							        <p:column style="color:blue;font-size:16px;text-align:center">
							        	<h:outputText value="#{contratoMB.planoVO.beneficioSuporteCadCardapioS}" />
							        </p:column>
							    </p:row>
							</p:panelGrid>	
							
							<br />
							
							<p:panel header="Detalhe Contato"  style="margin-bottom:20px">
									    
								<h:panelGrid id="gridContatoPlano" columns="2"  styleClass="ui-panelgrid">  
					            	<h:outputText value="#{msgs.numeroContrato}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<h:outputText id="numeroContrato" value="#{contratoMB.contratoVO.numeroContrato}" style="color:#A52A2A;font-size:19px;font-weight:bold;"/>
								            	
					            	<h:outputText value="#{msgs.contratoEmNome}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
						           	<p:inputText id="contratoEmNome" size="30" value="#{contratoMB.contratoVO.contratoEmNome}" style="color:#483D8B;font-size:15px;" maxlength="40"/>
	
					            	<h:outputText value="#{msgs.CNPJ}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<p:inputMask id="cnpj"  value="#{contratoMB.contratoVO.CNPJ}" style="color:#483D8B;font-size:15px;" mask="99.999.999/9999-99" size="20" />
									            	
					            	<h:outputText value="#{msgs.InsEstadual}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<p:inputText id="insEstadual"  value="#{contratoMB.contratoVO.insEstadual}" style="color:#483D8B;font-size:15px;" maxlength="20"/>
	
	    							<h:outputText value="#{msgs.contratoResponsavel}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<p:inputText id="nomeResponsavel" size="30" value="#{contratoMB.contratoVO.nomeResponsavel}" style="color:#483D8B;font-size:15px;" maxlength="50"/>
									            	
					            	<h:outputText value="#{msgs.contratoResponsavelCPF}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<p:inputMask id="cpf" value="#{contratoMB.contratoVO.cpf}" style="color:#483D8B;font-size:15px;" mask="999.999.999-99" size="20"/>
						            	
					            	<h:outputText value="#{msgs.contratoDtContratado}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<h:outputText id="dtContratado" value="#{contratoMB.contratoVO.dataContratacao}" style="color:#006600;font-size:15px;font-weight:bold;" size="20"/>
						            	
					            	<h:outputText value="#{msgs.contratoDtTermino}" style="color:#A8A8A8 ;font-size:14px;font-weight:bold;"/>
					            	<h:outputText id="dtTermino" value="#{contratoMB.contratoVO.dataTermino}" style="color:#990000;font-size:15px;font-weight:bold;" mask="99/99/9999" size="20"/>
						            	
		   						</h:panelGrid>  
						    </p:panel>
			  			</p:tab>
	
						<p:tab id="tabRestFilial" title="Restaurantes Filiais">  
						   <p:dataTable id="restFilialPlanoDT" var="planoRestaurante" value="#{contratoMB.restaurantesContratoL}" editable="true" style="margin-bottom:20px">
						       <f:facet name="header">
						           <h:outputText value="Restaurantes Filiais Associados Contrato" />
						       </f:facet>
							 
						       <p:ajax event="rowEdit" listener="#{contratoMB.onRowEdit}" />
						       <p:ajax event="rowEditCancel" listener="#{contratoMB.onRowCancel}" />
							 
						       <p:column headerText="Restaurante Filial">
					               <h:outputText value="#{planoRestaurante.nomeFantasia}"/>
						       </p:column>
							 
						       <p:column headerText="Total Cardápios Ativos">
					               <h:outputText value="#{planoRestaurante.totalGeralCardapios}"/>
						       </p:column>
							 
						       <p:column headerText="Status">
						       		<h:outputText value="#{planoRestaurante.status}" />
						       </p:column>

							   <p:column style="width:32px;text-align: center">
						       		<p:commandButton update=":form2:contratoRestauranteDetalheDialog" oncomplete="PF('contratoRestauranteDialog').show()" icon="ui-icon-search" title="Detalhes">
						            	<f:setPropertyActionListener value="#{planoRestaurante}" target="#{contratoMB.restaurantesContratoSelect}" />
						            </p:commandButton>
						       </p:column>							 
						   </p:dataTable>
						</p:tab>   
		           		
						<p:tab id="tabPagamento" title="Plano Pagamento">

							<p:dataTable id="pagamentoPlanoDT" var="pagamentoPlano" value="#{contratoMB.pgmContratoRestauranteL}" editable="true" 
							style="margin-bottom:20px" scrollHeight="350" scrollable="true" styleClass="ui-datatable" >
						       <f:facet name="header">
						           <h:outputText value="#{msgs.tituloPlanoPagamento}" />
						       </f:facet>

						       <p:column headerText="Data Pagto">
						               <h:outputText value="#{pagamentoPlano.dataPagamento}" />
						       </p:column>
						 
						       <p:column headerText="Parcela" style="width:10%">
						               <h:outputText value="#{pagamentoPlano.parcela}" />
						       </p:column>

						       <p:column headerText="Vencimento">
						               <h:outputText value="#{pagamentoPlano.dataVencimento}" />
						       </p:column>

						       <p:column headerText="Forma Pagamento" style="width:25%">
						 			<h:outputText value="#{pagamentoPlano.formaPagamentoSy.nomePagamento}" />
						       </p:column>
						       
						       <p:column headerText="Valor R$" style="width:15%">
						               <h:outputText value="#{pagamentoPlano.valorPagamento}" />
						       </p:column>
						 
						       <p:column headerText="Status Pagto">
						       		<h:outputText value="#{msgs.statusParcelaContratoPago}" rendered="#{pagamentoPlano.status == 1}" 
						       		style="font-weight:bold;color:#3300CC"/>
						       		
						       		<h:outputText value="#{msgs.statusParcelaContratoPendente}" rendered="#{pagamentoPlano.status == 0}" 
						       		style="font-weight:bold;color:#FF0000;"/>
						       		
						       		<h:outputText value="#{msgs.statusParcelaContratoErro}" rendered="#{pagamentoPlano.status == -1}" 
						       		style="font-weight:bold;color:#660000;"/>
						       		
						       		<h:outputText value="#{msgs.statusParcelaContratoAgendada}" rendered="#{pagamentoPlano.status == 2}"
						       		style="font-weight:bold;color:#33CC00;"/>
						       </p:column>
						 
						       <p:column style="width:32px">
						       
								<p:commandButton  title="Pagar Agora" icon="ui-iconPagarAgora" style="width:30px;height:30px;"
						  		rendered="#{pagamentoPlano.status == 0}" oncomplete="PF('dlgFormaPagRenovacao').show()" 
						  		update=":form2:pagamentoDialog">
						  			<f:setPropertyActionListener value="#{pagamentoPlano}" target="#{contratoMB.selectContratoPagamento}" />
						  			<f:setPropertyActionListener value="#{true}" target="#{contratoMB.statusPagamentoAtrasoPlano}" />
								</p:commandButton>						  								           
		
								<p:commandButton   title="Log Erro" icon="ui-iconLog" style="width:30px;height:30px;"
						  		action="#{contratoMB.editarCampos}" immediate="true" rendered="#{pagamentoPlano.status == -1}"/>						           

						       </p:column>
						   </p:dataTable>

						</p:tab>   
  				</p:tabView>
  			</p:panel>
    		</div>
	  	</div>
	</div>

	<!-- Copyright -->
	<div class="wrapper row4">
	  <footer id="copyright" class="clear">
	    <p class="fl_left">Copyright 2014 - All Rights Reserved - <a href="#">W7VM</a></p>
	    <p class="fl_right">W7VM <a href="http://www.w7vm.com/" title="Developer Application Mobile">Developer Application Mobile</a></p>
	  </footer>
	</div>
</h:form>
</h:body>
</html>